<% content_for :css do %>
  <%= stylesheet_link_tag 'new_or_edit','infos_new_or_edit' %>
<% end %>
<% content_for :javascript do %>
  <script type="text/javascript" charset="utf-8">
    function tmp_save()
    {
      <%= remote_function :url => info_url(@info),
            :method => :put,
            :with => "$('new_or_edit_info_form').serialize()",
            :loading => "$('tmp_saving').innerHTML = '暂存中...'",
            :failure => "$('tmp_saving').innerHTML = '暂存成功！点击暂存资讯'",
            :success => "$('tmp_saving').innerHTML = '暂存成功！点击暂存资讯'" %>
    } 
  </script>>
<% end %>
<%= javascript_include_tag :ckeditor %>
<div class='new_or_edit'>
  <div class='title'>
    编辑-资讯
  </div>
  <div class='body'>    
    <%= render :file => 'infos/_form.html' %>    
  </div>
  <div class='buttons'>
    <%= link_to_function "保存资讯并返回", "$('new_or_edit_info_form').submit()", :class => :submit %>
    <%= link_to_function "点击暂存资讯", 
          'tmp_save()',
          :class => 'other',
          :id => :tmp_saving
     %>
    <%= link_to "返回资讯管理", infos_url , :class => :return %>
  </div>
</div>  
<%= observe_form :new_or_edit_info_form,
      :frequency => 1,
      :function => "tmp_save()"
 %>   